import { postClient } from '@/utils/https';

// ------------ engine ------------

// 根据用户id，获取引擎列表
export const getEngineList = (userId: string) => {
  return postClient(`/engine/list`, { userId });
};

// 根据引擎id，释放引擎
export const releaseEngine = (userId: string, engineId: string) => {
  return postClient(`/engine/release`, { userId, engineId });
};

// 创建引擎
export const applyEngine = (params: {
  userId: string;
  engineName: string;
  cpu?: number;
  memory?: number;
  enableGpu?: 0 | 1;
  engineImage: string;
}) => {
  return postClient('/engine/apply', params);
};
